package com.narunas.shapes;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.RadialGradient;
import android.graphics.RectF;
import android.graphics.Shader;
import android.graphics.Typeface;
import android.view.View;

public class ChildShapeRoundRec extends View {

	Paint tPaint;
	Canvas cc;
	String tt;
	public ChildShapeRoundRec(Context context, String st) {
		super(context);
		
		tt =st;
		
		// TODO Auto-generated constructor stub
	}
	public void setText(String st){
		
		cc.drawText(st, 12.0f,75.0f, tPaint);
		
		
	}
	
	@Override 
	protected void onDraw(Canvas canvas) {
		
		super.onDraw (canvas);
			
		cc = canvas;
		
		Paint paint = new Paint();
		paint.setAntiAlias(true);
		paint.setShadowLayer(3, 3, 3, 0xFF000000);
		paint.setColor(Color.BLUE);
		RadialGradient rGrad = new RadialGradient(33, 33, 120, 0xFFdedede, 0xFF636363, Shader.TileMode.MIRROR);
		paint.setShader(rGrad);
		paint.setDither(true);
		
//		Paint tPaint = new Paint();
		tPaint = new Paint();
		tPaint.setColor(Color.LTGRAY);
		tPaint.setTypeface(Typeface.DEFAULT_BOLD);
		//tPaint.setTextAlign(Paint.Align.CENTER);
		tPaint.setTextSize(13.0f);
		//tPaint.setShadowLayer(5, 5, 5, 0xFFFFFFFF);
		tPaint.setAntiAlias(true);
		
		canvas.drawRoundRect(new RectF(0, 0, 40, 40), 10, 10,  paint);
		canvas.drawText(tt, 12.0f,75.0f, tPaint);
	}
}
